/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package researchgrants.parts.GrantRequest.filters;

import researchgrants.parts.GrantRequest.*;

/**
 * Filter a GrantRequest if its current status' code (flagged by the last status change), is as given
 * @author DOStudent1
 */
class GrantRequestFilterLastStatusChange implements GrantRequestFilter {

    private String dbCode;
    
    GrantRequestFilterLastStatusChange(String dbCode) {
        this.dbCode=dbCode;
    }

    public boolean isFiltered(GrantRequest grantRequest) {
        if (grantRequest.getLastStatusChange()!=null) {
            return(!grantRequest.getLastStatusChange().getStatusChangeCode().equals(dbCode));
        } else {
            return(true);
        }
                
    }

}
